# python3.3 新加了yield from语法
from itertools import chain

my_list = [1,2,3]
my_dict = {
    "name":"hlg",
    "address":"安徽",
}

def my_chain(*args, **kwargs):
    for my_iterable in args:

        # for value in my_iterable:
        #     yield value
        # 代替上面2行
        yield from my_iterable


# for value in chain(my_list, my_dict, range(5,10)):
#     print(value)
# 使用自己定义的chain
for value in my_chain(my_list, my_dict, range(5,10)):
    print(value)



